
from logging import (
    basicConfig,
    DEBUG,
    FileHandler,
    getLogger,
    INFO,
    StreamHandler,
)

from config import LOG_LEVEL, LOG_FILE_PATH


log_level = {
    'INFO': INFO,
    'DEBUG': DEBUG
}[LOG_LEVEL]

file_log = FileHandler(LOG_FILE_PATH)
console_out = StreamHandler()

basicConfig(
    handlers=(file_log, console_out), 
    format='[ %(asctime)s | %(levelname)s ]: %(message)s', 
    datefmt='%m.%d.%Y %H:%M:%S',
    level=log_level,
)

logger = getLogger(__package__)
